package com.xiaobing.common.exception;

//定义异常返回枚举类
public enum ExceptionCodeMsg {

    SUCCESS(200, "操作成功"),
    FAILURE(400, "业务异常"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    USERNAME_PASSWORD_IS_NULL(402, "用户名或者密码不能为空"),
    FORBIDDEN(403, "请求被拒绝"),
    NOT_FOUND(404, "404 没找到请求"),
    PASSWORD_LENGTH(410, "密码不在指定范围内,应在 5-20 位"),
    USERNAME_LENGTH(411, "用户名不在指定范围内,应在 2-20 位"),
    IP_BLACKLIST(412, "该IP已被加入黑名单"),
    ACCOUNT_DISABLED(413, "帐号已被禁用，请联系管理员"),
    NOT_ACCESS_PERMISSIONS(414, "没有内部访问权限，不允许访问"),
    NOT_TOKEN(415, "未提供token"),
    NOT_PERMISSION(416, "没有权限"),
    NOT_ROLE(417, "没有角色"),
    NOT_PERMISSION_TO_DEPT(418, "没有权限访问部门数据"),
    RESUBMIT_LOCK(419, "地址请求过于频繁,请稍后重试..."),
    RESUBMIT_LOCK_ERROR(420, "验证重复提交时,出现未知异常"),


    INTERNAL_SERVER_ERROR(500, "服务器异常"),


    ;

    private int code;
    private String message;

    ExceptionCodeMsg(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }


    public String getMessage() {
        return message;
    }

}
